package com.hz.service.impl;

import com.hz.dao.AdvertisingDao;
import com.hz.pojo.Advertising;
import com.hz.service.AdvertisingService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdvertisingServiceImpl implements AdvertisingService {

    @Resource
    private AdvertisingDao advertisingDao;

    @Override
    public Advertising getAdvertisingContent(Long advertising_id) throws Exception {
        return advertisingDao.getAdvertisingContent(advertising_id);
    }

    @Override
    public int addAdvertisingContent(Advertising advertising) throws Exception {
        return advertisingDao.addAdvertisingContent(advertising);
    }

    @Override
    public int updAdvertisingContent(Advertising advertising) throws Exception {
        return advertisingDao.updAdvertisingContent(advertising);
    }

    @Override
    public int delAdvertisingContent(Long advertising_id) throws Exception {
        return advertisingDao.delAdvertisingContent(advertising_id);
    }

    @Override
    public List<Advertising> getAll() throws Exception {
        return advertisingDao.getAll();
    }

    @Override
    public int updTrafficById(Long advertising_id, Long advertising_traffic) throws Exception {
        return advertisingDao.updTrafficById(advertising_id,advertising_traffic);
    }

    /*@Override
    public List<Advertising> getAdvertisingByTraffic() throws Exception {
        return advertisingDao.getAdvertisingByTraffic();
    }*/
}
